package com.suxin.decorator;

/**
 * @author Tang
 * @classname DecoratorWater
 * @description [  ]
 * @date 2021/5/10 14:12
 */
public abstract class DecoratorWater extends AbstractComponent{

    AbstractComponent component = null;

    private Integer price;

    public DecoratorWater(AbstractComponent component,Integer price) {
        this.price = price;
        this.component = component;
    }

    @Override
    int sellWater() {
        return this.component.sellWater() + getPrice();
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public Integer getPrice() {
        return price;
    }
}
